<template>
	<view class="container">
		<view class="votebox" v-if="datalist.length">
			<view class="voteitem bgWhite radius5 plr15 " v-for="(i,n) in datalist" :key="n" @click="toMain(i)">
				<view class="flex-col justify-between">
					<view class="title align-center">
						
						<text class="">遵守法纪法规</text>
					</view>
								
					<view v-if="i.createtime" class="mt5">
						{{ gettime(i.createtime)  }}
					</view>
				</view>
				<image src="../../static/images/hongbao.png" mode=""></image>
				
				
				
			</view>
		</view>
		
		<uv-empty v-if="datalist.length==0"></uv-empty>
		
	
		<customTab :active="0"></customTab>
	</view>
</template>

<script>
	import customTab from '../../components/customTab.vue';
	import { formatDateTime } from '../../utils/utils';
	let app = getApp();
	export default {
		components: {
		customTab
		},
		data() {
			return {
				act: 0,
				dataInfo:{},
				certificateNum:'',
				datalist:[],
				page:1
			}
		},
		onLoad(opt) {
			console.log(opt)
			this.page=1;
			this.getList()
		
		},
		
		mounted() {
			
		
		},
		// onReachBottom() {
		// 	this.page++;
			
		// },
		methods: {
			getList(){
				this.$api.systemNotice().then(res=>{
					console.log(res)
					this.datalist=res.data
				})
			},
			gettime(time){
				return formatDateTime(time)
			},
				
			toMain(item){
				uni.navigateTo({
					url:'/pages/noticeMain/index?id='+item.id
				})
			}
		}





	}
</script>
<style scoped lang="scss">
	.container {
		height: 100vh;
		padding: 36rpx 30rpx;
		
	}
	.votebox{
		
		background-color: #fff;
	}
	.voteitem{
		padding-top: 40rpx;
		padding-bottom: 30rpx;
		font-size: 28rpx;
		display: flex;
		justify-content: space-between;
		image{
			width: 200rpx;
			height: 150rpx;
		}
		color: #9B9BA2;
		.title{
			font-weight: 800;
			font-size: 30rpx;
			color: #000000;
			
			
		}
		}
	
</style>